package fem2.jlinalg;

import org.junit.Test;

import fem2.Debugger;
import fem2.jnative.JMKL;

public class JMKLTest {

	@Test
	public void test() {
		int n = 3;
		int[] ri = new int[] { 0, 1, 0, 1, 2, 1, 2 };
		int[] cp = new int[] { 0, 2, 5, 7 };
		double[] val = new double[] { 1, 1, 1, 1, 1, 1, 1 };
		double b[] = new double[] { 1, 2, 3 };
		double[] x = new double[3];
		JMKL.solve(n, val.length, cp, ri, val, x, b);

		Debugger.watch("x = ", x);

		/*
		 * to make sure left hand side matrix is not changed after solution
		 * process
		 */
		Debugger.watch("ri after solve = ", ri);
		Debugger.watch("cp after solve = ", cp);
		Debugger.watch("value after solve = ", val);
	}
}